home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
presto
/
presto10.lha
/
src
/
machdep.h
< prev
next >
Wrap
C/C++ Source or Header
|
1991-12-11
|
1KB
|
47 lines
#ifndef __presto__machdep_h__
#define __presto__machdep_h__
#ifdef sequent
// STACK GROWS DOWN
#define FP(p) ( (int*)(&p+1) )
#define STACK_BASE(b,s) b + s - 1
#define COPY_STACK(f,c,t) while (c--) *t-- = *f--
#define ACTIVE_STK_SZ(b,t) b - t + 1 /* size of active stack */
#define PUSH(sp,word) { *sp-- = word;}
#define SAVPC(fp) (int*)*((fp+1))
#define SAVFP(fp) (int*)*(fp)
#endif /* sequent */
#ifdef vax
//
// All just the same as on the sequent...
//
#define FP(p) ( (int*)(&p+1) )
#define STACK_BASE(b,s) b + s - 1
#define COPY_STACK(f,c,t) while (c--) *t-- = *f--
#define ACTIVE_STK_SZ(b,t) b - t + 1 /* size of active stack */
#endif /* vax */
#ifdef sun
// STACK GROWS UP, not down.
//
//#define FP(p) ( (int*)(&p+1) )
//#define STACK_BASE(b,s) b + s - 1
//#define COPY_STACK(f,c,t) while (c--) *t-- = *f--
//#define ACTIVE_STK_SZ(b,t) b - t + 1 /* size of active stack */
//#define PUSH(sp,word) { *sp-- = word;}
//#define SAVPC(fp) (int*)*((fp+1))
//#define SAVFP(fp) (int*)*(fp)
#endif /* sun */
#ifdef mips
extern void MipsSaveSP(int*);
extern void MipsRestoreSP(int);
#define FP(p) ( MipsSaveSP(&p), (int*)p )
#define STACK_BASE(b,s) b + s - 1
#define COPY_STACK(f,c,t) while (c--) *t-- = *f--
#define ACTIVE_STK_SZ(b,t) b - t + 1 /* size of active stack */
#endif /* mips */
#endif /* __presto__machdep_h__ */